function f():number{return 1}
function info(this:void,name:string = 'default',age?:number,...items:any[]){}

interface F{
    (x:number,y:number):boolean;
}
let fn:F = function (x:number,y:number){
    return x>y;
};

let log1=(message:string)=>console.log(message);

let log2=(message:string, code?:number)=>{
    console.log(`${message}>${code}`);
};

let log3=(message:string,code:number=0)=>{
    console.log(`${message}<${code}`);
};

log1('hello');
log2('hello');
log2('hello',2);
log3('hello');
log3('hello',2);

//overload
function show(name:string);
function show(age:number);
function show(str:any){
    if(typeof str === 'string'){
        console.log(`name:${str}`);
    }else{
        console.log(`age:${str}`);
    }
}

function work(name:string);
function work(name:string,age:number);
function work(name:string,age?:number){
    if(age){
        console.log(`name:${name},age:${age}`);
    }else{
        console.log(`name:${name}`);
    }
}
